#!/usr/bin/php

<?php

$elementName = strtolower($argv[1]);
$selfClosingTag = 'false';
if (isset($argv[2]) && !empty($argv[2]))
{
	$selfClosingTag = strtolower($argv[2]);
}
$classFile = "./$elementName.class.php";
if (file_exists($classFile)) die(-1);
$templateFile = "./template.txt";

$template = file_get_contents($templateFile);
$template = str_replace('@tagname@',$elementName,$template);
$template = str_replace('@selfclosingtag@',$selfClosingTag,$template);
$template = str_replace('@TAGNAME@',strtoupper($elementName),$template);
file_put_contents($classFile,$template);

exit(0);

?>
